package com.hyt.it.ogt.ykcj.common.enums;

/**
 * 报表分类枚举
 *
 * @author admin
 */
public enum AnalysisType {
  // 通用
  ANSLYSIS_TYPE_TOTAL("total", "total", "总成绩分析", ""),
  ANSLYSIS_TYPE_SUBJECT("subject", "subject_id", "成绩分析-按科目", "subjectId"),
  ANSLYSISE_TYPE_SEX("sex", "examinee_sex", "成绩分析-按性别", "sex"),
  ANSLYSIS_TYPE_AGE("age", "examinee_age", "成绩分析-按年龄区间", "ageRange"),
  ANSLYSIS_TYPE_AREA("area", "area", "成绩分析-按区域", "area"),
  UNKNOWN("unkonw", "unknow", "未知", "未知"),;
  // 分析类型
  private String code;

  // 数据库对应的字段名
  private String fieldName;


  // 文件描述
  private String desc;

  // 对象属性值
  private String propertyName;

  public String getPropertyName() {
    return propertyName;
  }

  public void setPropertyName(String propertyName) {
    this.propertyName = propertyName;
  }

  AnalysisType(String code, String fieldName, String desc, String propertyName) {
    this.code = code;
    this.fieldName = fieldName;
    this.desc = desc;
    this.propertyName = propertyName;
  }

  public static AnalysisType getAnalysisByCode(String code) {
    for (AnalysisType analysisType : AnalysisType.values()) {
      if (analysisType.getCode().equals(code)) {
        return analysisType;
      }
    }
    return AnalysisType.UNKNOWN;
  }

  public String getCode() {
    return code;
  }

  public String getFieldName() {
    return fieldName;
  }

  public String getDesc() {
    return desc;
  }
}
